#ifndef FESCREENBUILDER_PRIVATE_H
#define FESCREENBUILDER_PRIVATE_H
#include "fecore_global.h"
#include "fedom.h"
#include <QMap>

class QWidget;
class QLayout;
class FeWidgetFactory;
class FeActualDataService;

class FeScreenBuilder
{
public:
	FeScreenBuilder();
	virtual ~FeScreenBuilder();

	FeDOMDocument document() const;
	void setDocument(const FeDOMDocument &);

	FeWidgetFactory *widgetFactory() const;
	void setWidgetFactory(FeWidgetFactory *);

	FeActualDataService *actualDataService() const;
	void setActualDataService(FeActualDataService *);

	QWidget *buildScreen(const QString &name, QWidget *parent=0);

protected:
	virtual QWidget *buildScreenWidget(const FeDOMScreen &, QWidget *parent);
	virtual QLayout *buildLayout(const FeDOMLayout &layout, QWidget *widget);
	virtual QWidget *buildWidget(const FeDOMWidget &widget, QWidget *parent);
	virtual void setupSignalBinding(const FeDOMSignalBinding &binding, QWidget *screen);
	virtual void setupProperties(QWidget *widget, const QList<FeDOMProperty>&properties);

protected:
	QMap<QString, QWidget *> widgets;

private:
	Q_DISABLE_COPY(FeScreenBuilder)
	FeDOMDocument doc;
	FeWidgetFactory *wf;
	FeActualDataService *ads;
};

#endif // FESCREENBUILDER_PRIVATE_H